# coding=utf-8
# 全世界最帅的帅哥
import pymysql

from ysgg1_club_celery.config.celery_config import Config
from ysgg1_club_subject.comment.utils.decrypt_util import decrypt


def get_mysql_connection():
    return pymysql.connect(
        host=Config.HOSTNAME,
        port=Config.PORT,
        user=Config.USERNAME,
        password=decrypt(Config.ENCRYPTED_DATA),
        cursorclass=pymysql.cursors.DictCursor
    )


mysql_conn = get_mysql_connection()
print(mysql_conn)